from django.db import models


class Goods(models.Model):
    name = models.CharField(max_length=100)
    price = models.IntegerField()
    go_date = models.DateTimeField()
    img = models.CharField(max_length=120)
    nice = models.IntegerField()
    comments = models.IntegerField()
    sale = models.IntegerField()


class Order(models.Model):
    sn = models.CharField(max_length=80, unique=True)
    goods = models.ForeignKey(Goods, on_delete=models.SET_NULL, null=True)


class Comment(models.Model):
    goods = models.ForeignKey(Goods, on_delete=models.SET_NULL, null=True)
    content = models.CharField(max_length=140)
